home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #2
/
Monster Media No. 2 (Monster Media)(1994).ISO
/
prog_c
/
afpc.zip
/
AFPC.DOC
next >
Wrap
Text File
|
1994-06-16
|
3KB
|
91 lines
AFPC v1.10 - the Automatic Function Prototyper for C June 7/94
------------------------------------------------------------------------------
What is AFPC ?
--------------
AFPC is a program that takes care of that annoying (but necessary) facet of
C Language programming. Whenever you create a function, it is necessary also
to declare it's prototype. If you're like me, then the fuction's paramaters
constantly change. And this is extremely annoying 'cause you have to go find
the prototype and change it also.
What does it do ?
-----------------
AFPC alleviates this problem. Every time it is called, it scans the
C source file and finds all functions. It then takes the function names and
writes the corresponding function prototypes to a header file of the same name
as the C source file.
How do you run it?
------------------
Simply type : AFPC sourcefile(s) <Enter>
This causes the source file(s) to be scanned and header file(s) created.
eg. AFPC test.c lib.c strings.c<Enter>
will create the header file(s) test.h, lib.h, strings.h.
Assuming that the functions :
void TestMe(char *a) { }
void WatchThis(int a, FILE *b, char c) { }
were in test.c, test.h would then look like :
void TestMe(char *a);
void WatchThis(int a, FILE *b, char c);
Just make sure to include the statement "#include "filename.h"" in your C
source file and everything will compile fine.
C++ Support
-----------
I've implemented support for the // comment but haven't had time to
learn C++ yet. I think AFPC should work fine on C++ but there's only one way
to find out.
Limitations
-----------
AFPC currently doesn't support function coded like this :
void TestMe(int, char)
int a;
char b;
{}
For now, you will have to code like void TestMe(int a, char b) {}
if you wish to use AFPC.
AFPC does not support the same function names defined twice in a
source file. An example would be with the #ifdef and #else statements. In
C it is legal to do this :
#ifdef UNIX
void TestFunction(char *) {
printf("This is a test\n");
}
#else
void TestFunction(char *, int) {
printf("This is a test\n");
}
but AFPC will write the function to the header file in both formats. If it is
absolutely necessary to do something like this, resort to the old method (ie.
the hard way).
Unfortunately...
----------------
Time is money, and to make up for this investment I am selling this
program. Obviously, it is a real time saver as it alleviates that annoying
task of defining (and redefining) function prototypes.
Bearing this in mind, I crippled (gasp!) the program so that it only
writes up to 5 functions. The commercial version will handle all your functions
and it costs $25 US.